<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use App\Models\CourseModel;

class CourseArrangeModel extends BaseModel
{
    use HasFactory;
    protected $table = 'course_arrange';
    public $timestamps = false;
    protected $fillable = [
        'company_id',
        'class_id',
        'course_id',
        'teacher_id',
        'room_id',
        'date',
        'time',
        'status',
        'course_num',
        'total_course_num',
        'total_course_money',
        'attend_student_num',
        'commission',
        'arrange_log_id'
    ];

    public function course() {
        return $this->belongsTo(CourseModel::class, 'course_id', 'id');
    }

    public function class() {
        return $this->belongsTo(ClassModel::class, 'class_id', 'id');
    }

    public function room() {
        return $this->belongsTo(RoomModel::class, 'room_id', 'id');
    }

    public function teacher() {
        return $this->belongsTo(TeacherModel::class, 'teacher_id', 'id');
    }
}
